﻿@using IterationLife.Extensions.Enums
@using Util.Ui
@model IterationLife.PlatformBackEnd.AppServices.Dtos.Systems.AttachmentDto
@{
    var x = @Html.EasyUi();
}
@{
    var id = Guid.NewGuid().ToString("N");
}
<script type="text/javascript">
    layui.use('upload', function () {
        layui.upload({
            elem: '#@(id)',
            after: function (result) {
                $("#Id_" + "@(id)").val(result.Id);
                $("#Size_" + "@(id)").val(result.SizeText);
                $("#Address_" + "@(id)").val(result.Address);
                return {
                    url: result.Address
                };
            }
        });
    });
</script>
<input type="file" id="@(id)" name="file" class="layui-upload-file" lay-method="post" lay-url="/systems/Attachment/Upload" lay-preview-url="@(Model.Address)" lay-ext="@(Model.FileType.Extensions())" >
<input type="text" id="Id_@(id)" name="@(Model.LabelName).Id" value="@(Model.Id)" hidden />
<input type="text" id="Size_@(id)" name="@(Model.LabelName).Size" value="@(Model.SizeText)" hidden />
<input type="text" id="Address_@(id)" name="@(Model.LabelName).Address" value="@(Model.Address)" hidden/>